import {
    createRouter,
    createWebHashHistory
} from "vue-router"
import PageHome from "../pages/PageHome.vue"
import contentHome from "../components/contentHome.vue"
import contentChannel from "../components/contentChannel.vue"
import contentMe from "../components/contentMe.vue"
import PageVideos from "../pages/PageVideos.vue"
import PageLogin from "../pages/PageLogin.vue"
import PageSearch from "../pages/PageSearch.vue"
import PageHistory from "../pages/PageHistory.vue"


const router = createRouter({
    history: createWebHashHistory(),
    routes: [{
            path: "/",
            component: PageHome,
            redirect: '/home',
            children: [{
                    path: "home",
                    component: contentHome
                },
                {
                    path: "channel",
                    component: contentChannel,
                },
                {
                    path: "me",
                    component: contentMe
                },

            ]
        },
        {
            /**视频详情*/
            path: "/videos",
            name: 'videoDetil',
            component: PageVideos,
            props: true
        },
        {
            path: "/login",
            component: PageLogin
        },
        {
            path: "/search",
            component: PageSearch
        },
        {
            path: "/history",
            component: PageHistory
        }


    ],
    linkExactActiveClass: 'RouterActive'
});

export default router;